﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Front/MinSite.Master" AutoEventWireup="true" CodeBehind="SubmitReserve.aspx.cs" Inherits="VK.Casemeet.Web.Front.SubmitReserve" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contentHead" runat="server">
    <link href="/Front/css/sale.css" rel="stylesheet" type="text/css" media="all" />
    <script type="text/javascript" src="/Front/js/sale.js"></script>
    <script type="text/javascript">
        $("document").ready(function () {
            if (<% =area1 %> == 0) {
                BindArea(0, "#ddlArea1", 0, 0, 0);
            } else {
                BindArea(0, "#ddlArea1", <% =area1 %>, <% =area2 %>, <% =area3 %>);
            }
        });

        function BindArea(parentID, ddlControl, area1, area2, area3) {
            $.ajax({
                type: "post",
                url: "/Admin/CommService.asmx/GetArea",
                dataType: "json",
                contentType: "application/json;charset=utf-8",
                data: "{ \"parentID\":" + parentID + " }",
                beforeSend: function (jsonHttpRequest) {
                    this;
                },
                success: function (jsonHttpRequest, textStatus) {
                    var temp_option = new String;
                    temp_option += "<option value=\"0\">请选择</option>";
                    if (ddlControl == "#ddlArea1") { temp_option = fillOption(temp_option, jsonHttpRequest, area1); }
                    if (ddlControl == "#ddlArea2" && parentID != "0") { temp_option = fillOption(temp_option, jsonHttpRequest, area2); }
                    if (ddlControl == "#ddlArea3" && parentID != "0") { temp_option = fillOption(temp_option, jsonHttpRequest, area3); }
                    $(ddlControl).html(temp_option);
                    if (ddlControl == "#ddlArea1") {
                        BindArea($(ddlControl).val(), "#ddlArea2", area1, area2, area3);
                    }
                    if (ddlControl == "#ddlArea2") {
                        BindArea($(ddlControl).val(), "#ddlArea3", area1, area2, area3);
                    }
                },
                error: function (jsonHttpRequest, textStatus, errorThrown) {
                    this;
                },
                complete: function (jsonHttpRequest, textStatus) {
                    this;
                }
            });
        }
        function area1_onchange() {
            if ($("#ddlArea1").val() != "0") {
                $("#ddlArea2").html("");
                $("#hidArea").val($("#ddlArea1")[0].options[$("#ddlArea1")[0].selectedIndex].text);
                BindArea($("#ddlArea1").val(), "#ddlArea2", 0, 0, 0);
            }
        }
        function area2_onchange() {
            if ($("#ddlArea2").val() != "0") {
                $("#ddlArea3").html("");
                $("#hidArea").val($("#ddlArea1")[0].options[$("#ddlArea1")[0].selectedIndex].text + " " + $("#ddlArea2")[0].options[$("#ddlArea2")[0].selectedIndex].text);
                BindArea($("#ddlArea2").val(), "#ddlArea3", 0, 0, 0);
            }
        }
        function area3_onchange() {
            if ($("#ddlArea3").val() != "0") {
                $("#hidArea").val($("#ddlArea1")[0].options[$("#ddlArea1")[0].selectedIndex].text + " " + $("#ddlArea2")[0].options[$("#ddlArea2")[0].selectedIndex].text + " " + $("#ddlArea3")[0].options[$("#ddlArea3")[0].selectedIndex].text);
            }
        }
        function fillOption(temp_option, jsonHttpRequest, area) {
            $.each(jsonHttpRequest.d, function (i, field) {
                if (area == field.AreaID) {
                    temp_option += "<option selected value=\"" + field.AreaID + "\">" + field.Name + "</option>";
                } else {
                    temp_option += "<option value=\"" + field.AreaID + "\">" + field.Name + "</option>";
                }
            });
            return temp_option;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentBody" runat="server">
<!--S 卖家信息 -->  
<dl class="saleForm">
    
    <dd><div class="saleName"><i>*</i>真实姓名：</div><div class="saleEntry"><asp:TextBox ID="txtName" runat="server" placeholder="填写真实姓名" CssClass="saleIpt"></asp:TextBox></div></dd>
    
    <dd><div class="saleName"><i>*</i>您的性别：</div><div class="saleEntry" style="padding-top:10px;"><asp:RadioButtonList ID="radSex" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="radioList"></asp:RadioButtonList></div></dd>
    
    <dd><div class="saleName"><i>*</i>所在地区：</div>
        <div class="saleEntry">
            <select id="ddlArea1" name="ddlArea1" onchange="area1_onchange();" class="saleSlt {min:1, messages:{min:'请选择一项'}}" style="width:auto;"></select>
		    <select id="ddlArea2" name="ddlArea2" onchange="area2_onchange();" class="saleSlt {min:1, messages:{min:'请选择一项'}}" style="width:auto;"></select>
		    <select id="ddlArea3" name="ddlArea3" onchange="area3_onchange();" class="saleSlt {min:1, messages:{min:'请选择一项'}}" style="width:auto;"></select>
        </div>
    </dd>
    
    <dd><div class="saleName"><i>*</i>联系电话：</div><div class="saleEntry"><asp:TextBox ID="txtPhone" runat="server" placeholder="填写手机号码" CssClass="saleIpt"></asp:TextBox></div></dd>
    
    <dd><div class="saleName"><i></i>QQ号码：</div><div class="saleEntry"><asp:TextBox ID="txtQq" runat="server" placeholder="QQ号码" CssClass="saleIpt"></asp:TextBox></div></dd>
    
    <dd><div class="saleName"><i>*</i>通讯地址：</div><div class="saleEntry"><asp:TextBox ID="txtAddress" runat="server" placeholder="填写通讯地址" CssClass="saleIpt" TextMode="MultiLine" Height="56px"></asp:TextBox></div></dd>
    <% =strMessage %>
    <dd><div class="saleName">&nbsp;</div><div class="saleEntry"><asp:LinkButton ID="butSubmit" runat="server" CssClass="saleBtn" onclick="butSubmit_Click">提交</asp:LinkButton></div></dd>
    
    <div class="clear"></div>
</dl>
</asp:Content>
